package com.woniuxy.dr_mall.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuxy.dr_mall.entity.DrCart;
import com.woniuxy.dr_mall.mapper.DrCartMapper;
import com.woniuxy.dr_mall.service.IDrCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 张哲轩
 * @since 2021-08-11
 */
@Service
public class DrCartServiceImpl extends ServiceImpl<DrCartMapper, DrCart> implements IDrCartService {

    @Autowired
    private DrCartMapper cartMapper;

    @Override
    public List<DrCart> getCartsByUserId(int userId) {
        return cartMapper.getCartsByUserId(userId);
    }

    @Override
    public void clearCart(int userId) {
        cartMapper.clearCart(userId);
    }
}
